﻿using System.ComponentModel;

using Holdem.Interfaces.Model;

namespace Holdem.Model
{
    public class StartingHandContext : IStartingHandsContext, INotifyPropertyChanged
    {
        private string _startingHand;

        public string Title
        {
            get
            {
                return _startingHand;
            }
            set
            {
                if (_startingHand == value)
                    return;

                _startingHand = value;
                OnPropertyChanged("Title");
            }
        }

        private bool _isSelected;

        public bool IsSelected
        {
            get
            {
                return _isSelected;
            }
            set
            {
                if (_isSelected == value)
                    return;

                _isSelected = value;
                OnPropertyChanged("IsSelected");
            }
        }

        public StartingHandContextType HandType
        {
            get { throw new System.NotImplementedException(); }
            set { throw new System.NotImplementedException(); }
        }

        public StartingHandContext(string title, bool isSelected)
        {
            this.Title = title;
            this.IsSelected = isSelected;
        }

        public event PropertyChangedEventHandler PropertyChanged;

        public void OnPropertyChanged(string propertyName)
        {
            if (PropertyChanged != null)
                PropertyChanged(this, new PropertyChangedEventArgs(propertyName));
        }

        public override string ToString()
        {
            return this.Title;
        }

    }
}
